home *** CD-ROM | disk | FTP | other *** search
- #include <exec/exec.h>
- #include <stdio.h>
- void sr(char *s);
- char File[200];
- char TFile[200];
- main(int argc,char *argv[])
- {
- FILE *fi,*fo;
- if(argc!=2)
- {
- printf("\n");
- printf("BlankAway version 1.0, written by Joseph Hodge\n");
- printf("usage: BlankAway <filename>\n");
- printf(" ie: BlankAway sys:text\n");
- printf("\n");
- exit(0);
- }
- strcpy(File,argv[1]);
- sr(File);
- strcpy(TFile,File);
- strcat(TFile,".");
- if(access(File,0))
- {
- printf("\nFile %s does not exist\n\n",File);
- exit(0);
- }
- Rename(File,TFile);
- fo=fopen(File,"w");
- fi=fopen(TFile,"r");
- while(fgets(File,180,fi)!=NULL)
- {
- sr(File);
- if(strlen(File)!=0) fprintf(fo,"%s\n",File);
- }
- fclose(fi);
- fclose(fo);
- DeleteFile(TFile);
- printf("Conversion Complete\n");
-
- exit(0);
-
- }
-
- void sr(char *s)
- {
- register int i;
- i=strlen(s)-1;
- while(i>-1)
- {
- if(*(s+i)<=' ') *(s+i)='\0'; else break;
- i--;
- }
- }